-- -*- mode: lua; -*-

local bd = require("blockdiagram")

return bd.system
{
   imports = {
      "stdtypes",
      "random",
      "ptrig",
      "lfds_cyclic"
   },

   blocks = {
      { name="b1", type="ubx/random" },
      { name="b2", type="ubx/random" },
      { name="ptrig1", type="ubx/ptrig" },
   },

   -- node config
   node_configurations = {
      global_rnd_conf = {
	 type = "struct random_config",
	 config = { min=333, max=999 },
      },
   },

   configurations = {

      { name="b1", config = { min_max_config = "&global_rnd_conf"} },
      { name="b2", config = { min_max_config = "&global_rnd_conf"} },

      { name="ptrig1",
	config = {
	   period = {sec=1, usec=0 },
	   chain0={
	      { b="#b1", num_steps=1, measure=0 },
	      { b="#b2", num_steps=1, measure=0 } } } }
   },
}
